package com.industrial.operation.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Set;

import com.industrial.common.core.utils.uuid.IdUtils;
import com.industrial.common.security.utils.SecurityUtils;
import com.industrial.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.industrial.operation.mapper.OperationKnowledgeLabelMapper;
import com.industrial.operation.domain.OperationKnowledgeLabel;
import com.industrial.operation.service.IOperationKnowledgeLabelService;

/**
 * 知识标签管理Service业务层处理
 * 
 * @author Zhou_S
 * @date 2024-02-20
 */
@Service
public class OperationKnowledgeLabelServiceImpl implements IOperationKnowledgeLabelService 
{
    @Autowired
    private OperationKnowledgeLabelMapper operationKnowledgeLabelMapper;

    /**
     * 查询知识标签管理
     * 
     * @param baseId 知识标签管理主键
     * @return 知识标签管理
     */
    @Override
    public OperationKnowledgeLabel selectOperationKnowledgeLabelByBaseId(String baseId)
    {
        return operationKnowledgeLabelMapper.selectOperationKnowledgeLabelByBaseId(baseId);
    }

    /**
     * 查询知识标签管理列表
     * 
     * @param operationKnowledgeLabel 知识标签管理
     * @return 知识标签管理
     */
    @Override
    public List<OperationKnowledgeLabel> selectOperationKnowledgeLabelList(OperationKnowledgeLabel operationKnowledgeLabel)
    {
        return operationKnowledgeLabelMapper.selectOperationKnowledgeLabelList(operationKnowledgeLabel);
    }

    /**
     * 新增知识标签管理
     * 
     * @param operationKnowledgeLabel 知识标签管理
     * @return 结果
     */
    @Override
    public int insertOperationKnowledgeLabel(OperationKnowledgeLabel operationKnowledgeLabel)
    {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        operationKnowledgeLabel.setBaseId(IdUtils.simpleUUID());
        operationKnowledgeLabel.setBaseCreateTime(new Date());
        operationKnowledgeLabel.setBaseUpdateTime(new Date());
        operationKnowledgeLabel.setCreator(loginUser.getUsername());
        return operationKnowledgeLabelMapper.insertOperationKnowledgeLabel(operationKnowledgeLabel);
    }

    /**
     * 修改知识标签管理
     * 
     * @param operationKnowledgeLabel 知识标签管理
     * @return 结果
     */
    @Override
    public int updateOperationKnowledgeLabel(OperationKnowledgeLabel operationKnowledgeLabel)
    {
        return operationKnowledgeLabelMapper.updateOperationKnowledgeLabel(operationKnowledgeLabel);
    }

    /**
     * 批量删除知识标签管理
     * 
     * @param baseIds 需要删除的知识标签管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationKnowledgeLabelByBaseIds(String[] baseIds)
    {
        return operationKnowledgeLabelMapper.deleteOperationKnowledgeLabelByBaseIds(baseIds);
    }

    /**
     * 删除知识标签管理信息
     * 
     * @param baseId 知识标签管理主键
     * @return 结果
     */
    @Override
    public int deleteOperationKnowledgeLabelByBaseId(String baseId)
    {
        return operationKnowledgeLabelMapper.deleteOperationKnowledgeLabelByBaseId(baseId);
    }
}
